{extend name="default/shops/base" /}
{block name="title"}商品咨询-卖家中心{__block__}{/block}
{block name="content"}
<style>
.c999{color:#999;}
.consult{margin-bottom: 15px;}
.consultImg,.consultImg a,.consultImg a img{width: 50px !important;height: 50px !important}
</style>
<div class="wst-shop-head"><span>商品咨询</span></div>
<div class="wst-shop-tbar">
  <label>
    咨询分类：
    <select name="consultType" id="consultType" class="s-query">
        <option value="0">-请选择-</option>
      {volist name=":WSTDatas('COUSULT_TYPE')" id="vo"}
            <option value="{$vo['dataVal']}" >{$vo['dataName']}</option>
      {/volist}
    </select>
  </label>
  <label>
    关键词：<input type="text" id="consultKey" class="s-query" /><a class="s-btn" onclick="queryByPage()">查询</a>
  </label>
  <label>
    <a class="s-btn" style="float: right;line-height:16px;height:16px;margin-top:2px;"  onclick="editConsult(0,-1)">批量隐藏</a>
  </label>
  <label>
    <a class="s-btn" style="float: right;line-height:16px;height:16px;margin-top:2px;" onclick="editConsult(1,-1)">批量显示</a>
  </label>
</div>
<div class="wst-shop-content"> 
   <table class='wst-list'>
   <thead>
   <tr>
     <th width="10" >
       <div class="checkbox-box-s checkbox-box-s-all">
       <input style="margin-left:2px;" class="wst-checkbox-s" onclick="javascript:WST.checkChks(this,'.chk')" type='checkbox' id="all"/>
       <label for="all"></label>
       </div>
     </th>
     <th width="40">序号</th>
     <th width="40">显示</th>
     <th width="300">商品</th>
     <th width="500">咨询内容</th>
   </tr>
   </thead>
   <tbody id='list'></tbody>
   <tfoot>
     <tr><td colspan='10' style='padding-top:10px;text-align:center;'>
       <div id='pager'></div>
     </td></tr>
   </tfoot>
   
   <script id="tblist" type="text/html">
   {{# for(var i = 0; i < d.length; i++){ }}
   <tr>
      <td>
      <div class="checkbox-box-s">
      <input type='checkbox'  class='chk wst-checkbox-s' id="chk-{{i}}" value='{{d[i]['id']}}' /><label for="chk-{{i}}"></label>
      </div>
      </td>
      <td>{{i+1}}</td>
      <td><div  title='双击可修改' ondblclick='editConsult({{d[i]["isShow"] == 0? 1:0}},{{d[i]["id"]}})' class="w-r {{((d[i]['isShow']==1)?'right':'wrong')}}"></div></td>
      <td>
          <div class="appra-img consultImg">
          <a target='_blank' href="{{WST.U("home/goods/detail","goodsId="+d[i]['goodsId'])}}">
            <img class='gImg'  data-original='__RESOURCE_PATH__/{{d[i].goodsImg}}'/>
          </a>
        </div>
          <p class="appra-goodsName" style="height:auto;">
            {{WST.cutStr(d[i]['goodsName'],43)}}
          </p>
      </td>
         <td>
         <p class='consult'>
          [{{(WST.blank(d[i]['loginName'])=='')?'游客':d[i]['loginName']}}]：{{d[i]['consultContent']}} <span class="c999">({{d[i]['createTime']}})</span>
         </p>

            <div class="reply-box">
              {{# if(d[i]['reply']==null || d[i]['reply']=='') { }}
              <textarea style="width:98%;height:80px;" id="reply-{{d[i]['id']}}" placeholder='3~200个字符长度' maxlength='200'></textarea>
              <a class="reply-btn s-btn" style="margin-left:3px;" onclick="reply(this,{{d[i]['id']}})">回复</a>
              {{# }else{ }}
               <p class="reply-content">{{d[i]['reply']}}【{{d[i]['replyTime']}}】</p>
              {{# } }}

            </div>
         </td>
      </tr>

   {{# } }}
   </script>
  </table>
</div>
{/block}  
{block name="js"}
<script type='text/javascript' src='__STYLE__/shops/goodsconsult/goodsconsult.js?v={$v}'></script>
<script>
$(function(){
  queryByPage();
})
</script>
{/block}